package com.msmall.community.bbs.action.html;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.tiles.AttributeContext;
import org.apache.tiles.context.TilesRequestContext;
import org.apache.tiles.preparer.ViewPreparer;

import com.msmall.community.ApplicationManager;
import com.msmall.community.bbs.model.Board;
import com.msmall.community.bbs.service.BoardManager;

public class NavigationPreparer implements ViewPreparer{

	public void execute(TilesRequestContext tilesContext, AttributeContext context) {
		HttpServletRequest request = (HttpServletRequest) tilesContext.getRequest();
		BoardManager bm = (BoardManager) ApplicationManager.appContext.getBean("boardManager");
		List<Board> boards = bm.getAllAvailableBoard();
		request.setAttribute("nav_boards", boards);
		
	}

}
